<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSystemNoticesTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('system_notices', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title')->comment('通知标题');
            $table->text('receiver')->comment('通知接收者');
            $table->text('content')->nullable()->comment('通知内容');
            $table->unsignedInteger('created_by')->comment('创建者');
            $table->unsignedTinyInteger('type')->default(0)->comment('通知类型，0:系统消息');
            $table->string('data_scope')->nullable()->comment('数据域');
            $table->timestamps();

            $table->comment = '系统通知表';
            $table->engine = 'InnoDB';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('system_notices');
    }

}
